<template>
    <div>
        <el-form ref="formRef" style="padding: 0 8px" label-width="130px" :model="formData">
            <el-card class="!border-none mb-4">
                <div class="font-medium mb-7">企查查:
                </div>
                <el-form-item label="Key">
                    <div class="w-80">
                        <el-input class="w-[500px]" placeholder="请输入Key" v-model="formData.qcc_key" clearable>
                        </el-input>
                    </div>
                    <el-alert description="请填写企查查的Key" type="info" :closable="false" />
                </el-form-item>
                <el-form-item label="Secret Key">
                    <div class="w-80">
                        <el-input class="w-[500px]" placeholder="请输入Secret Key" clearable v-model="formData.qcc_secret">
                        </el-input>
                    </div>
                    <el-alert description="请填写企查查的Secret Key" type="info" :closable="false" />
                </el-form-item>
            </el-card>
        </el-form>
        <footer-btns>
            <el-button type="primary" @click="addHandle">保存</el-button>
        </footer-btns>
    </div>
</template>
<script lang="ts" setup>
import {
    getQccConfig,
    setQccConfig
} from '@/api/setting/qcc'
const formData = ref({
    qcc_key: "",
    qcc_secret: ""
})
const gerLists = async () => {
    const results = await getQccConfig({})
    formData.value = results
}
const addHandle = async () => {
    await setQccConfig(formData.value)
}
gerLists()
</script>